[Feature/sat] Satellite prediction#879
[Feature/sat] Satellite prediction#879MichaelWheeley wants to merge 23 commits intoaccius:Stagingfrom
Conversation
pass tle data from useSatellites.js
# Conflicts: # src/hooks/useSatellites.js
accius
left a comment
There was a problem hiding this comment.
Good progress on satellite prediction — the pass table and auto-refresh are nice additions. A few things to address:
Must fix
XSS risk in onclick handler — Satellite names and TLE lines are injected unescaped into an inline onclick:
onclick="openSatellitePredict('${sat.name}', '${sat.tle1}', '${sat.tle2}')"A satellite name containing ' breaks the handler; malicious content is injectable. Use data- attributes with a delegated event listener, or escape the values.
Interval leak — window.satellitePredictInterval is overwritten if a second modal opens before the first interval fires. The old interval keeps running. Clear the previous one before assigning:
if (window.satellitePredictInterval) clearInterval(window.satellitePredictInterval);Carries all #877 issues — This PR includes #877's commits, so the hardcoded colors, broken nested <table> HTML, duplicate style attribute, and valueAsNumber ?? fallback bugs all apply here too. Fix those in #877 first.
Should fix
Commented-out code — Large blocks in useSatelliteLayer.js (~30 lines) are commented out rather than removed. Either delete them now or open an issue to track it — don't ship dead code in comments.
Hardcoded button colors — background: #440000; border: 1px solid #ff4444 on the satellite name button won't work in Light/Retro themes. Use CSS variables.
Worth discussing
dayjs dependency — Does the project already have date utilities that could handle the format() and diff() calls? Adding a new dependency for a few date operations adds bundle weight. Not a blocker if the team is fine with it.
60s full recomputation — The interval recomputes all orbital passes every minute. Since pass times only shift meaningfully over hours, you could just update the "from now" column without rerunning the orbital math.
…ed legacy code since satellite location calculations are now done as a hook in useSatellites.js
…no longer updated unless modal is reopened or if 'satellites' is updated. Display Time From Now as hours:minutes:seconds
What does this PR do?
Type of change
How to test
Checklist
server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)var(--accent-cyan), etc.).bak,.old,console.logdebug lines, or test scripts includedScreenshots (if visual change)
with many satellites in the window it should now be possible to mouse scroll up and down

each satellite listed is now a button - press it to get a prediction modal
